<!doctype html>
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5">
<title>无标题文档</title>

<link rel="stylesheet" type="text/css" href="resources/css/jquery.mobile-1.1.0.min.css">
<link rel="stylesheet" type="text/css" href="resources/css/drag_bar.css">
<script src="resources/js/jquery-1.7.2.min.js"></script>
<script src="resources/js/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript" src="resources/js/common.js"></script>
<script type="text/javascript" src="resources/cubiq-iscroll-a8b8720/src/iscroll.js"></script>
<script src="resources/js/cordova-2.1.0.js"></script>
<script src="resources/js/phonegap_exitlogin.js"></script>
<script src="resources/js/drag_bar.js"></script>
<script type="text/javascript">
		var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
		document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2284c04845acdcd94dd640a8555927dc' type='text/javascript'%3E%3C/script%3E"));
		</script>
<script type="text/javascript">
var localStr=window.location.href,v,m;
$(function(){
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
	addEventListener("orientationchange", function() { setTimeout(hideURLbar, 0); }, false);
	addEventListener("load",function(){$("#loading").hide();
	$(".floatBoxBg").hide();});
      function hideURLbar(){ 
               window.scrollTo(0,1); 
      }
      if(navigator.userAgent.toLowerCase().indexOf("android", 0)<0){
         $("#footer").css({"center;z-index":"999","position":"fixed","bottom":"0"});
         window.scrollTo(0,1); 
        }else{
    $("#footer").css({"position":"fixed","bottom":"0"});
    var top = $("#footer").offset().top;
	if(localStr.indexOf("file:///",0)<0)
	{
	    $(window).scroll(function(){
	   		 $("#footer").offset({top:$(document).scrollTop()+top});
	    });
	    
	    //如果是客户端，给退出按钮绑定phoneGap写文件事件
	    $("#exitImg").bind("click",function(){
	    	onDeviceReady_exitlogin();
	    })
	}
 }
	
}); 
document.addEventListener("deviceready", onDeviceReady_exitlogin, false);
$(document).ready(function() {

	initbar();
	
	if(localStr.indexOf("file:///",0)<0&&detectDeviceType()=="Android"){
		$("#client").hide();
		$("#dlclient").show();
	}else{
		$("#client").show();
		$("#dlclient").hide();
	}
	var useragent=navigator.userAgent;
	var w=window.screen.width;
	if(useragent.indexOf("Android 4")>0)
	{
		$("meta").attr("content","width="+w/0.78+", initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5");
	
	}
	
	if(localStorage.getItem("width")==null){
		localStorage.setItem("width",window.screen.width);
		localStorage.setItem("height",window.screen.height);
	}
	if(localStorage.getItem("width")>700) {
		$("meta").attr("content","width=device-width, initial-scale=0.7, minimum-scale=0.7, maximum-scale=0.7");
	}
	if(window.screen.height>window.screen.width){
		Vertical();
	}
	$( window ).bind( "orientationchange", function() {
		//initbar();
		changeScreen();
	});
});
function initbar()
{
	var url=jsonserver+"personalconfig/getdata/phone/"+localStorage.getItem("curphone");
	$.getJSON(url+".jsonp?callback=?",{},
	function(data){
		errorcheck(data.sb.status,data.sb.msg);
		if(data.warn_status=="yes"){
				
				$("#takeButton").attr("src","resources/css/images/system/images/close.png");
				$("#openFlag").val("1");
			}else {
				
				$("#takeButton").attr("src","resources/css/images/system/images/set_on.jpg");
				$("#openFlag").val("0");
		}
		initslider("1",parseInt(data.day_over_abs),parseInt(data.day_max_abs));
		initslider("2",parseInt(data.package_over_per),parseInt(data.package_flow_total));
		if($("#openFlag").val()=="1")
		{
			$("fieldset").attr("disabled","disabled");
		}
	});
}
function changeScreen(){
	if(window.screen.height>window.screen.width){
		Vertical();
		} 
	else {
		$("#content").removeAttr("style");
		$("#mainconfig").removeAttr("style");
	}
	}
function Vertical(){
	var screenheigh = localStorage.getItem("height");
	if(screenheigh<=500){
		$("#mainconfig").get(0).style.height="630px";
	}
	else if(screenheigh>1100){
		$("#mainconfig").get(0).style.height=0.56*screenheigh+"px";
	}
	else{
		$("#mainconfig").get(0).style.height=0.82*screenheigh+"px";
	}
	}
function takeOn() 
{
	if($("#openFlag").val()=="0") 
	{
		$(".floatBoxBg").show();
		$("#loading").show();
		var urlon=jsonserver+"personalconfig/phone/"+localStorage.getItem("curphone")+"/day_over_abs/"+$("#slider1").attr("value")+"/package_over_per/"+$("#packageOver").text();
		$.getJSON(urlon+".jsonp?callback=?",{},function(data){
			errorcheck(data.sb.status,data.sb.msg);
				if(data.sb.status=="00000") {
				$("#takeButton").attr("src","resources/css/images/system/images/close.png");
				$("fieldset").attr("disabled","true");
				$("#openFlag").val("1");
				}
			});
	}
	else
	{
		var urloff=jsonserver+"personalconfig/offdata/phone/"+localStorage.getItem("curphone");
		$.getJSON(urloff+".jsonp?callback=?",{},function(data){
			errorcheck(data.sb.status,data.sb.msg);
			if(data.sb.status=="00000") {
				$("#takeButton").attr("src","resources/css/images/system/images/set_on.jpg");
				$("fieldset").removeAttr("disabled");
				$("#openFlag").val("0");
				}
			});
	}
		$(".floatBoxBg").hide();
		$("#loading").hide();
}
function exit(){
	localStorage.clear();
	var locstr=window.location.href;
	window.location.href='login.html';
}




</script>
<style type="text/css">
.mainConfig{
	width:100%; height:200%;
	border-radius:10px; 
	border:0px solid #dfdfdf; 
	background-color:#ffffff
}


</style>
<link href="resources/css/load.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#ffffff" style="height:100%;">

    <!--<div id="loading" class="loading"><img src="resources/css/images/loading.gif"/>载入中...</div>
    <div class="floatBoxBg"></div>-->
<div style="width:100%; background-image:url(resources/css/images/top_bg.jpg); height:88px"><table width="100%" height="88px" border="0">
  <tr>
    <td style="width:18%; max-width:110px; padding-left:5px"><img src="resources/css/images/warning/images/fanhui.png" width="90%" style="max-width:99px" onClick="javascript:window.location.href='index.html'"/></td>
    <td style="text-align: center; font-size: 40px;">设置</td>
    <td width="21%" style="max-width:max-width:110px; padding-right:5px; text-align:right"><img src="resources/css/images/system/images/set_exit.png" width="90%"  style="max-width:121px" onClick="exit()" id="exitImg"/></td>
  </tr>
</table>

    </div>
<div style="margin-left: 10px; margin-right: 10px; background-color:#ffffff">
    <div style="font-size:9px">&nbsp;</div>
    <div style="margin-top: 30px; margin-left: 30px; font-size: 36px; ">流量预警</div>
     <div style="width:100%; margin-top:15px"><img src="resources/css/images/system/images/line.png" width="100%"/></div>
    <div id="mainconfig" class="mainConfig" style="margin-top:15px;"  >
    
   
    
    <!--Jquery Mobile -->
    <div style="margin-top: 20px; margin-left: 30px; font-size: 32px; color:#666">单日流量使用达到:</div>
    	<div style="width:200px; height:20px; text-align:center; margin-bottom:10px; font-size:26px; font-family:'黑体'; color:#494b4e;" id="showdata1"></div>
        <div id="drag1" style="margin-left:10%">

        </div>
        
		<div id="showdata11" style=" font-size:22px; font-family:'黑体';  color:#435b77;"><div style="width:50%; text-align:left; float:left;">0MB</div><div id="showmax1" style="width:50%; text-align:right;float:left;"></div></div>
        <br/>
        <br/>
        <br/>
         <div style="margin-top: 15px; margin-left: 30px; font-size: 32px; color:#666">套餐流量使用达到:</div>
        <div style="width:200px; height:20px; clear:both; text-align:center; font-size:26px; font-family:'黑体'; color:#494b4e  ;" id="showdata2"></div>
         <br/>
            <div id="drag2" style="margin-left:10%">
 
            </div>  
         <br/>
        
		<div id="showdata22" style=" font-size:22px; font-family:'黑体';  color:#435b77; "><div style="width:50%; text-align:left;float:left;">0MB</div><div id="showmax2" style="width:50%; text-align:right;float:left;"></div></div>
      <!--------->      
       
            
    <div style="margin-top:60px; margin-left:30px; margin-bottom:40px; font-size: 36px; color:#666">流量超出设定值，将收到预警短信.</div>
    <div style="width:100%; text-align:center; margin-top:60px; margin-bottom:10px"><img  id="takeButton" src="resources/css/images/system/images/set_on.jpg" width="32%" style="max-width:198px" onClick="takeOn()"/><input type="hidden" id="openFlag" value="0"/></div>
    </div>
  <div id="footer" style="font-size: 24px; text-align:center; background-image:url(resources/css/images/bottom_share_bg.png);width:100%; margin-top:-5px;">
   <table width="100%" border="0">
  	<tr>
    <td width="20%"><div style="max-width:101px; margin-left:10px;"><img src="resources/css/images/system/images/share_btn.png" width="100%" onClick="javascript:window.location.href='share.html'"/></div></td>
    <td align="center"><div id="dlclient" onClick="download()">下载云管家客户端，更多给力功能</div><div id="client">COOL！流量变化随时掌握</div></td>
  	</tr>
   </table>
</div>
    </div>


</body>
	
		
</html>
